﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link rel="stylesheet" href="Content/bootstrap-theme.css" />
    <link rel="stylesheet" href="Content/bootstrap.css" />
    <link rel="stylesheet" href="Content/Site.css" />
    <link rel="stylesheet" href="Content/jquery-ui.min.css" />

    <script type="text/javascript" src="scripts/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="scripts/bootstrap.min.js"></script>
    <script type="text/javascript" src="scripts/jquery-ui.min.js"></script>
    <script type="text/javascript" src="scripts/modernizr-2.7.2.js"></script>
    <script type="text/javascript" src="scripts/respond.js"></script>
    <script type="text/javascript" src="scripts/jquery.validate.min.js"></script>
    <script type="text/javascript" src="scripts/PriceGrid.js"></script>
</head>
<body>


    <div class="row">
        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" id="steps">
            <br />
            <form role="form" class="form">

                <div class="row collapse in" id="stepAll">
                    <div class="col-lg-5" style="margin-bottom:15px;">
                        <h2 style="margin-top:0px;">Step 1</h2>
                        <div class="row">
                            <div class=" col-lg-11 form-group">
                                <label for="exampleInputEmail1">Building</label>
                                <select class="form-control" id="HotelOptions">
                                    
                                </select>
                            </div>
                            <div class="col-lg-12 form-group">
                                <label for="exampleInputEmail1">Room Type</label>
                                <br />
                                <div class="btn-group" data-toggle="buttons" id="DivRoomTypes">
                                </div>
                            </div>
                            <div class="col-lg-12 form-group">
                                <label for="exampleInputEmail1">Rate Plan</label>
                                <br />
                                <div class="btn-group" data-toggle="buttons" id="DivRatePlans">

                                </div>
                            </div>
                            <div class="col-lg-12 form-group">
                                <label for="exampleInputEmail1">Occupancy Type</label>
                                <div class="form-inline">
                                    <div class="btn-group" data-toggle="buttons" id="DivOccupancies">
                                        <label class="btn btn-default ">
                                            <input type="checkbox"> First Adult
                                        </label>
                                        <label class="btn btn-default">
                                            <input type="checkbox"> Second Adult
                                        </label>
                                        <label class="btn btn-default">
                                            <input type="checkbox"> Third Adult
                                        </label>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-7" style="margin-bottom:15px;">
                        <h2 style="margin-top:0px;">Step 2</h2>
                        <div class="row">
                            <div class="col-lg-11  form-group" style="margin-bottom:0px;">
                                <div class="row">
                                    <div class="col-lg-6 form-group">
                                        <label for="exampleInputEmail1">From Date</label>
                                        <input type="text" id="fromdate" />
                                    </div>
                                    <div class="col-lg-6 form-group">
                                        <label for="exampleInputEmail1">To Date</label>
                                        <input type="text" id="todate" />
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-12  form-group">
                                <label for="exampleInputEmail1">Bulk Filter</label>
                                <br />
                                <div class="btn-group" data-toggle="buttons">
                                    <label class="btn btn-default ">
                                        <input type="checkbox" value="1" id="bulkYes" onchange="OnSelectBulkFilter('yes');"> Yes
                                    </label>
                                    <label class="btn btn-default active">
                                        <input type="checkbox" value="0" id="bulkNo" onchange="OnSelectBulkFilter('no');" checked > No
                                    </label>
                                </div>
                            </div>
                            <div class="col-lg-12  form-group">
                                <label for="exampleInputEmail1">Days of Week</label>
                                <br />
                                <div class="btn-group" data-toggle="buttons" id="DivDaysOfWeek">
                                    <!--<label class="btn btn-default active">
                                        <input type="checkbox" checked> All
                                    </label>-->
                                    <label class="btn btn-default">
                                        <input type="checkbox"> Mon
                                    </label>
                                    <label class="btn btn-default">
                                        <input type="checkbox"> Tue
                                    </label>
                                    <label class="btn btn-default">
                                        <input type="checkbox"> Wed
                                    </label>
                                    <label class="btn btn-default">
                                        <input type="checkbox"> Thu
                                    </label>
                                    <label class="btn btn-default">
                                        <input type="checkbox"> Fri
                                    </label>
                                    <label class="btn btn-default">
                                        <input type="checkbox"> Sat
                                    </label>
                                    <label class="btn btn-default">
                                        <input type="checkbox"> Sun
                                    </label>
                                </div>
                            </div>

                            <div class="col-lg-12  form-group">
                                <label for="exampleInputEmail1">Attribute</label>
                                <br />
                                <div class="btn-group" data-toggle="buttons" id="DivAttributes">
                                    <!--<label class="btn btn-default active">
                                        <input type="checkbox" value="All" checked> All
                                    </label>-->
                                    <label class="btn btn-default">
                                        <input type="checkbox"> Allocation
                                    </label>
                                    <label class="btn btn-default">
                                        <input type="checkbox"> Current Net Rate
                                    </label>
                                    <label class="btn btn-default">
                                        <input type="checkbox"> Minimun Nights
                                    </label>
                                    <label class="btn btn-default">
                                        <input type="checkbox"> Release Days
                                    </label>
                                    <label class="btn btn-default">
                                        <input type="checkbox"> Stop Sale
                                    </label>
                                </div>
                            </div>
                            <div class="col-lg-12 form-group text-center" style="margin-bottom:0px;margin-top:15px;">
                                <button type="button" class="btn btn-primary" onclick="ShowPriceGridResults()"><i class="fa fa-table fa-fw fa-lg"></i> Show Grid</button>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
            <div class="row" style="margin:0px;">
                <div class="col-lg-12 text-center" style="height: 1px; background-color: #dddddd;margin-top:15px;margin-bottom:30px;">
                    <a type="button" data-toggle="collapse" data-parent="#steps" href="#stepAll" class="btn btn-info btn-xs" style="position: relative; top: -1.0em;">
                        <i id="showHide" class="fa fa-chevron-circle-up fa-fw fa-lg"></i>
                    </a>
                </div>
            </div>



            <div class="row">
                <div class="col-lg-12 text-center" style="margin-bottom:15px;">
                    <button type="button" class="btn btn-warning" style="margin-right:15px;"><i class="fa fa-search-plus fa-fw fa-lg"></i> Preview</button>
                    <button type="button" class="btn btn-success" onclick="SavePriceGridData()"><i class="fa fa-save fa-fw fa-lg"></i> Save</button>
                </div>

                <div class="col-lg-12" id="DivPriceGrid">



                </div>
            </div>
        </div>

    </div>


    <script type="text/javascript">

        var data = [{ "HotelId": "d5614625-857f-487e-b98b-8726e8337321", "HotelName": "Test Hotel1", "ContractId": "7f9783d6-905f-4f39-804a-294145ebb57e", "Currency": "GBP", "ContractType": "Freesale", "Rooms": [{ "RoomId": "cbdb05fa-29dc-4a2d-82a9-475bf6badb20", "RoomName": "Test Room1", "RoomTypeId": "e64c2b03-e9a0-4cc5-98fc-1e47dd586a01", "RoomTypeName": "Test Room1", "RatePlans": [{ "RatePlanId": "b4a6c5db-ec8b-410f-b9c0-29b9c67ce37d", "BoardId": "2cf6e69e-607c-494f-a545-df6b1569778f", "Board": "Half Board", "CancellationPolicyId": "cancellation policy id", "CancellationPolicy": "cancellation policy", "CostUnit": 0, "FeaturedPlan": false, "FromDate": "2014-11-01T00:00:00", "Name": "Test Room1 Half Board", "ReleaseDays": 2, "ToDate": "2014-12-31T00:00:00", "Prices": [{ "PriceId": "349d26db-20d1-4b8f-8d4a-7664c10a58b4", "Occupancies": [{ "OccupancyType": "FirstAdult", "Price": 56.0000 }, { "OccupancyType": "SecondAdult", "Price": 0.0000 }, { "OccupancyType": "ThridAdult", "Price": 45.0000 }, { "OccupancyType": "FourthAdult", "Price": 56.0000 }, { "OccupancyType": "FifthAdult", "Price": 34.0000 }, { "OccupancyType": "SixthAdult", "Price": 34.0000 }, { "OccupancyType": "FirstChild", "Price": 34.0000 }, { "OccupancyType": "SecondChild", "Price": 23.0000 }, { "OccupancyType": "ThirdChild", "Price": 45.0000 }, { "OccupancyType": "FourthChild", "Price": 56.0000 }], "FromDate": "2014-12-16T00:00:00", "ToDate": "2014-12-31T00:00:00", "PerStayPrice": 34.0000, "PerUnitPrice": 34.0000 }, { "PriceId": "9485408c-f907-4db6-b8a0-9503c5b4b620", "Occupancies": [{ "OccupancyType": "FirstAdult", "Price": 23.0000 }, { "OccupancyType": "SecondAdult", "Price": 0.0000 }, { "OccupancyType": "ThridAdult", "Price": 35.0000 }, { "OccupancyType": "FourthAdult", "Price": 12.0000 }, { "OccupancyType": "FifthAdult", "Price": 34.0000 }, { "OccupancyType": "SixthAdult", "Price": 24.0000 }, { "OccupancyType": "FirstChild", "Price": 24.0000 }, { "OccupancyType": "SecondChild", "Price": 23.0000 }, { "OccupancyType": "ThirdChild", "Price": 65.0000 }, { "OccupancyType": "FourthChild", "Price": 34.0000 }], "FromDate": "2014-12-01T00:00:00", "ToDate": "2014-12-15T00:00:00", "PerStayPrice": 435.0000, "PerUnitPrice": 67.0000 }, { "PriceId": "0a60417a-0fb3-40c3-a8cf-aff895861f9b", "Occupancies": [{ "OccupancyType": "FirstAdult", "Price": 23.0000 }, { "OccupancyType": "SecondAdult", "Price": 0.0000 }, { "OccupancyType": "ThridAdult", "Price": 45.0000 }, { "OccupancyType": "FourthAdult", "Price": 26.0000 }, { "OccupancyType": "FifthAdult", "Price": 23.0000 }, { "OccupancyType": "SixthAdult", "Price": 45.0000 }, { "OccupancyType": "FirstChild", "Price": 25.0000 }, { "OccupancyType": "SecondChild", "Price": 23.0000 }, { "OccupancyType": "ThirdChild", "Price": 53.0000 }, { "OccupancyType": "FourthChild", "Price": 25.0000 }], "FromDate": "2014-11-01T00:00:00", "ToDate": "2014-11-30T00:00:00", "PerStayPrice": 34.0000, "PerUnitPrice": 66.0000 }], "TotalPrice": 0.0 }, { "RatePlanId": "055e247a-b322-48f9-a16d-a3159958c244", "BoardId": "1379b924-83a9-4f6e-8e7c-b9db2a284625", "Board": "Self Catering", "CancellationPolicyId": "cancellation policy id", "CancellationPolicy": "cancellation policy", "CostUnit": 1, "FeaturedPlan": false, "FromDate": "2014-11-01T00:00:00", "Name": "Test Room1 Self Catering", "ReleaseDays": 0, "ToDate": "2014-12-31T00:00:00", "Prices": [{ "PriceId": "513e54e6-20bf-4053-b997-18a0234326c2", "Occupancies": [{ "OccupancyType": "FirstAdult", "Price": 34.0000 }, { "OccupancyType": "SecondAdult", "Price": 45.0000 }, { "OccupancyType": "ThridAdult", "Price": 24.0000 }, { "OccupancyType": "FourthAdult", "Price": 45.0000 }, { "OccupancyType": "FifthAdult", "Price": 12.0000 }, { "OccupancyType": "SixthAdult", "Price": 42.0000 }, { "OccupancyType": "FirstChild", "Price": 23.0000 }, { "OccupancyType": "SecondChild", "Price": 32.0000 }, { "OccupancyType": "ThirdChild", "Price": 12.0000 }, { "OccupancyType": "FourthChild", "Price": 23.0000 }], "FromDate": "2014-11-21T00:00:00", "ToDate": "2014-12-10T00:00:00", "PerStayPrice": 345.0000, "PerUnitPrice": 346.0000 }, { "PriceId": "763fcdf4-d389-48e9-acfb-73e472ce6370", "Occupancies": [{ "OccupancyType": "FirstAdult", "Price": 35.0000 }, { "OccupancyType": "SecondAdult", "Price": 23.0000 }, { "OccupancyType": "ThridAdult", "Price": 23.0000 }, { "OccupancyType": "FourthAdult", "Price": 12.0000 }, { "OccupancyType": "FifthAdult", "Price": 23.0000 }, { "OccupancyType": "SixthAdult", "Price": 23.0000 }, { "OccupancyType": "FirstChild", "Price": 23.0000 }, { "OccupancyType": "SecondChild", "Price": 23.0000 }, { "OccupancyType": "ThirdChild", "Price": 22.0000 }, { "OccupancyType": "FourthChild", "Price": 32.0000 }], "FromDate": "2014-11-01T00:00:00", "ToDate": "2014-11-20T00:00:00", "PerStayPrice": 345.0000, "PerUnitPrice": 321.0000 }, { "PriceId": "e5e02f79-26b9-40bc-aa58-a3e612f2a737", "Occupancies": [{ "OccupancyType": "FirstAdult", "Price": 44.0000 }, { "OccupancyType": "SecondAdult", "Price": 23.0000 }, { "OccupancyType": "ThridAdult", "Price": 67.0000 }, { "OccupancyType": "FourthAdult", "Price": 57.0000 }, { "OccupancyType": "FifthAdult", "Price": 12.0000 }, { "OccupancyType": "SixthAdult", "Price": 36.0000 }, { "OccupancyType": "FirstChild", "Price": 32.0000 }, { "OccupancyType": "SecondChild", "Price": 35.0000 }, { "OccupancyType": "ThirdChild", "Price": 45.0000 }, { "OccupancyType": "FourthChild", "Price": 75.0000 }], "FromDate": "2014-12-11T00:00:00", "ToDate": "2014-12-31T00:00:00", "PerStayPrice": 346.0000, "PerUnitPrice": 785.0000 }], "TotalPrice": 0.0 }] }, { "RoomId": "47f485b5-e69c-42d1-be03-c3fb22b132e3", "RoomName": "Test Room2", "RoomTypeId": "4e4f74cc-57b0-451b-b94d-515d980f9092", "RoomTypeName": "Test Room2", "RatePlans": [{ "RatePlanId": "dbd8c69a-1c69-4ffc-8122-8dee4f7e549b", "BoardId": "f6671011-e3a0-4cc8-b3bc-26df5d941ca3", "Board": "Full Board", "CancellationPolicyId": "cancellation policy id", "CancellationPolicy": "cancellation policy", "CostUnit": 1, "FeaturedPlan": false, "FromDate": "2014-11-01T00:00:00", "Name": "Test Room2 Full Board", "ReleaseDays": 0, "ToDate": "2014-12-31T00:00:00", "Prices": [{ "PriceId": "fe44aa5e-c8d2-40c8-be4f-d8b95526d02b", "Occupancies": [{ "OccupancyType": "FirstAdult", "Price": 45.0000 }, { "OccupancyType": "SecondAdult", "Price": 23.0000 }, { "OccupancyType": "ThridAdult", "Price": 12.0000 }, { "OccupancyType": "FourthAdult", "Price": 24.0000 }, { "OccupancyType": "FifthAdult", "Price": 23.0000 }, { "OccupancyType": "SixthAdult", "Price": 43.0000 }, { "OccupancyType": "FirstChild", "Price": 32.0000 }, { "OccupancyType": "SecondChild", "Price": 34.0000 }, { "OccupancyType": "ThirdChild", "Price": 67.0000 }, { "OccupancyType": "FourthChild", "Price": 54.0000 }], "FromDate": "2014-11-01T00:00:00", "ToDate": "2014-12-31T00:00:00", "PerStayPrice": 345.0000, "PerUnitPrice": 324.0000 }], "TotalPrice": 0.0 }] }] }];

    $(document).ready(function () {

        masterData = data;
        DisplayHotelList();

        $.each(data[0].Rooms, function (i, item) {
            var roomhtml = "<input type='checkbox' onchange='OnRoomTypeSelect()' value=" + item.RoomId + " checked>" + item.RoomName + "</label>";
            if (i == 0) {
                $('#DivRoomTypes').append("<label class='btn btn-default active'>" + roomhtml);
                selectedRoomtypes.push(item.RoomId);

                GenerateRatePlans(item.RatePlans);

            }
            else {
                $('#DivRoomTypes').append("<label class='btn btn-default'>" + roomhtml);
            }

        })

    });



    </script>

    

    <script type="text/javascript">

        $('#stepAll').on('hidden.bs.collapse', function () {
            $('#showHide').removeClass("fa-chevron-circle-up");
            $('#showHide').addClass("fa-chevron-circle-down");
        })

        $('#stepAll').on('shown.bs.collapse', function () {
            $('#showHide').removeClass("fa-chevron-circle-down");
            $('#showHide').addClass("fa-chevron-circle-up");
        })
    </script>

    <script type='text/javascript'>
    $(function () {
        $("#fromdate").datepicker();
    })
    $(function () {
        $("#todate").datepicker();
    })
    </script>
    
</body>
</html>
